package com.wiz.weixin.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wiz.weixin.TO.FuellingDataTO;
import com.wiz.weixin.VO.MemberVO;
import com.wiz.weixin.mapper.FuellingDataMapper;
import com.wiz.weixin.service.FuellingDataService;
import com.wiz.weixin.util.PageView;
/**
 * 加油记录
 * @author xxy
 *
 */
@Service("fuellingDataService")
public class FuellingDataServiceImpl implements FuellingDataService {

	@Resource
	private FuellingDataMapper fuellingDataMapper;
	@Override
	public PageView list(PageView pageView,List<MemberVO> list) {
		
		
		List<String> memberIds = new ArrayList<String>();
		List<FuellingDataTO> fuellingDatas = new ArrayList<FuellingDataTO>();
		
		if(list == null || list.size()<=0){
			pageView.setRecords(fuellingDatas);
			return pageView;
		}
		
		for (MemberVO memberVO : list) {
			memberIds.add(memberVO.getMemberId());
		}
		//测试
		memberIds.add("10005114317861");
		
		Map<Object, Object> map = new HashMap<Object, Object>();
		map.put("paging", pageView);
		map.put("list", memberIds);
		fuellingDatas = fuellingDataMapper.query(map);
		pageView.setRecords(fuellingDatas);
		return pageView;
	}

}
